//
//  os_api.cpp
//  testpcap
//
//  Created by bugforever on 1/16/15.
//  Copyright (c) 2015 bugforever. All rights reserved.
//

#include "os_api.h"

#ifdef _WIN32
#include "windows.h"
#else
#include <unistd.h>
#include <sys/time.h>
#include <time.h>
#endif

unsigned long get_time()
{
    unsigned long nTime = 0;
    
#ifdef _WIN32
    nTime = timeGetTime();
#else
    struct timeval tval;
    gettimeofday(&tval, NULL);
    nTime = ( unsigned long )(tval.tv_sec*1000 + tval.tv_usec/1000);
#endif // _WIN32
    
    return nTime;
}
